home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / PInterfaces / SCSI.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  4.8 KB  |  130 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Sunday, January 6, 1991 at 11:14 PM
  3.     SCSI.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.         Copyright Apple Computer, Inc.    1986-1990
  7.         All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT SCSI;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingSCSI}
  21. {$SETC UsingSCSI := 1}
  22.  
  23. {$I+}
  24. {$SETC SCSIIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingTypes}
  27. {$I $$Shell(PInterfaces)Types.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := SCSIIncludes}
  30.  
  31. CONST
  32. scInc = 1;
  33. scNoInc = 2;
  34. scAdd = 3;
  35. scMove = 4;
  36. scLoop = 5;
  37. scNop = 6;
  38. scStop = 7;
  39. scComp = 8;
  40. scCommErr = 2;                                  {communications error, operation timeout}
  41. scArbNBErr = 3;                                 {arbitration timeout waiting for not BSY}
  42. scBadParmsErr = 4;                              {bad parameter or TIB opcode}
  43. scPhaseErr = 5;                                 {SCSI bus not in correct phase for attempted operation}
  44. scCompareErr = 6;                               {data compare error}
  45. scMgrBusyErr = 7;                               {SCSI Manager busy }
  46. scSequenceErr = 8;                              {attempted operation is out of sequence}
  47. scBusTOErr = 9;                                 {CPU bus timeout}
  48. scComplPhaseErr = 10;                           {SCSI bus wasn't in Status phase}
  49. sbSIGWord = $4552;
  50. pMapSIG = $504D;
  51.  
  52. TYPE
  53. Block0 = PACKED RECORD
  54.     sbSig: INTEGER;                             {unique value for SCSI block 0}
  55.     sbBlkSize: INTEGER;                         {block size of device}
  56.     sbBlkCount: LONGINT;                        {number of blocks on device}
  57.     sbDevType: INTEGER;                         {device type}
  58.     sbDevId: INTEGER;                           {device id}
  59.     sbData: LONGINT;                            {not used}
  60.     sbDrvrCount: INTEGER;                       {driver descriptor count}
  61.     ddBlock: LONGINT;                           {1st driver's starting block}
  62.     ddSize: INTEGER;                            {size of 1st driver (512-byte blks)}
  63.     ddType: INTEGER;                            {system type (1 for Mac+)}
  64.     ddPad: ARRAY [0..242] OF INTEGER;           {ARRAY[0..242] OF INTEGER; not used}
  65.     END;
  66.  
  67. Partition = PACKED RECORD
  68.     pmSig: INTEGER;                             {unique value for map entry blk}
  69.     pmSigPad: INTEGER;                          {currently unused}
  70.     pmMapBlkCnt: LONGINT;                       {# of blks in partition map}
  71.     pmPyPartStart: LONGINT;                     {physical start blk of partition}
  72.     pmPartBlkCnt: LONGINT;                      {# of blks in this partition}
  73.     pmPartName: PACKED ARRAY [0..31] OF CHAR;   {ASCII partition name}
  74.     pmParType: PACKED ARRAY [0..31] OF CHAR;    {ASCII partition type}
  75.     pmLgDataStart: LONGINT;                     {log. # of partition's 1st data blk}
  76.     pmDataCnt: LONGINT;                         {# of blks in partition's data area}
  77.     pmPartStatus: LONGINT;                      {bit field for partition status}
  78.     pmLgBootStart: LONGINT;                     {log. blk of partition's boot code}
  79.     pmBootSize: LONGINT;                        {number of bytes in boot code}
  80.     pmBootAddr: LONGINT;                        {memory load address of boot code}
  81.     pmBootAddr2: LONGINT;                       {currently unused}
  82.     pmBootEntry: LONGINT;                       {entry point of boot code}
  83.     pmBootEntry2: LONGINT;                      {currently unused}
  84.     pmBootCksum: LONGINT;                       {checksum of boot code}
  85.     pmProcessor: PACKED ARRAY [0..15] OF CHAR;  {ASCII for the processor type}
  86.     pmPad: ARRAY [0..187] OF INTEGER;           {512 bytes long currently unused}
  87.     END;
  88.  
  89. SCSIInstr = RECORD
  90.     scOpcode: INTEGER;
  91.     scParam1: LONGINT;
  92.     scParam2: LONGINT;
  93.     END;
  94.  
  95.  
  96. FUNCTION SCSIReset: OSErr;
  97.     INLINE $4267,$A815;
  98. FUNCTION SCSIGet: OSErr;
  99.     INLINE $3F3C,$0001,$A815;
  100. FUNCTION SCSISelect(targetID: INTEGER): OSErr;
  101.     INLINE $3F3C,$0002,$A815;
  102. FUNCTION SCSICmd(buffer: Ptr;count: INTEGER): OSErr;
  103.     INLINE $3F3C,$0003,$A815;
  104. FUNCTION SCSIRead(tibPtr: Ptr): OSErr;
  105.     INLINE $3F3C,$0005,$A815;
  106. FUNCTION SCSIRBlind(tibPtr: Ptr): OSErr;
  107.     INLINE $3F3C,$0008,$A815;
  108. FUNCTION SCSIWrite(tibPtr: Ptr): OSErr;
  109.     INLINE $3F3C,$0006,$A815;
  110. FUNCTION SCSIWBlind(tibPtr: Ptr): OSErr;
  111.     INLINE $3F3C,$0009,$A815;
  112. FUNCTION SCSIComplete(VAR stat: INTEGER;VAR message: INTEGER;wait: LONGINT): OSErr;
  113.     INLINE $3F3C,$0004,$A815;
  114. FUNCTION SCSIStat: INTEGER;
  115.     INLINE $3F3C,$000A,$A815;
  116. FUNCTION SCSISelAtn(targetID: INTEGER): OSErr;
  117.     INLINE $3F3C,$000B,$A815;
  118. FUNCTION SCSIMsgIn(VAR message: INTEGER): OSErr;
  119.     INLINE $3F3C,$000C,$A815;
  120. FUNCTION SCSIMsgOut(message: INTEGER): OSErr;
  121.     INLINE $3F3C,$000D,$A815;
  122.  
  123.  
  124. {$ENDC}    { UsingSCSI }
  125.  
  126. {$IFC NOT UsingIncludes}
  127.     END.
  128. {$ENDC}
  129.  
  130.